Example data: data from all plots in Validation of Protocol

Hashtag (#) in the code chucks contain notes or additional code that can be run if the # is removed.

Install and Load packages

library(readxl)
library(dplyr)
library(tidyr)
library(ggplot2)
library(readr)

Set working directory

setwd("...")

data <- read.csv("Example_uptake_data.csv")

blank <- data %>%
  filter(Concentration == "0") %>% #filter for blank sample. #0 in standard curve. 
  summarize(mean = mean(Signal))%>% pull(mean) #calculate the mean blank value

data <- data%>%
  mutate(
    Signal_corr = case_when(
      Sample_ID == "Oocyte" ~ Signal - blank,          # subtract for oocyte samples
      Sample_type == "Standard" ~ Signal - blank,      # subtract for standards (Sample_ID is NA)
      Sample_ID == "Buffer" ~ Signal,                  # keep raw for buffer samples
      TRUE ~ Signal),                                  # fallback (if any other type)
    Signal_corr = pmax(Signal_corr, 0)          # Set negatives to 0
  )

Standard <- filter(data, Sample_type == "Standard") %>% #make dataframe with only standard samples 
  dplyr::select(-c(4:9))%>%     # remove unnecessary columns 
  mutate(Concentration = Concentration / 1000) #Convert to µM

Samples <- filter(data, !Sample_type %in% c("Standard", "Blank"))  %>%  #make dataframe with only assay samples
  dplyr::select(-c(4:5))

Check that signal do not increase above standard curve

std_min <- min(Standard$Signal_corr, na.rm = TRUE) #lowest signal, should be 0 since negatives are 0
std_max <- max(Standard$Signal_corr, na.rm = TRUE) #highest signal

Samples_check <- Samples %>%
  mutate(Out_of_range = case_when(
      Signal_corr < std_min ~ "Below standard range",
      Signal_corr > std_max ~ "Above standard range",
      TRUE ~ "OK"
    )
  )

Samples_check %>% filter(Out_of_range != "OK") #if any samples about of range they will be shown when run
## [1] Signal         Concentration  Sample_type    Sample_ID      RNA           
## [6] Assay_comments Assay          Signal_corr    Out_of_range  
## <0 rækker> (eller 0-længde row.names)

Generate standard curve

curve <- lm(Signal_corr ~ Concentration, data = Standard)
slope <- coef(curve)[2]
intercept <- coef(curve)[1]
summary(curve)
## 
## Call:
## lm(formula = Signal_corr ~ Concentration, data = Standard)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -18221   -251    313    388  39868 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)     -410.9     1557.6  -0.264    0.794    
## Concentration  22686.2      472.7  47.994   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 8210 on 34 degrees of freedom
## Multiple R-squared:  0.9855, Adjusted R-squared:  0.985 
## F-statistic:  2303 on 1 and 34 DF,  p-value: < 2.2e-16
r2 <- summary(curve)$r.squared

eq_label <- paste0(
  "y = ", round(slope, 3), "x + ", round(intercept, 3),
  "\nR² = ", round(r2, 3)
)
ggplot(Standard, aes(x = Concentration, y = Signal_corr)) +
  geom_point(size = 3, alpha = 0.7, color = "steelblue") +
  geom_abline(intercept = intercept, slope = slope, color = "red", size = 1) +
  theme_classic() +
  labs(x = "Concentration (µM)", y = "RFU")+
   annotate("text", x = 0.1, y = max(Standard$Signal_corr)*0.95,
           label = eq_label, hjust = 0, size = 4)+
  scale_y_continuous(labels = scales::comma, breaks = c(seq(0,250000,50000)))

Estimated concentrations

Calculate the estimated concentration in the samples based on the standard curve

Calculated concentration is saved in “Concentration” column

Samples <- Samples %>%
  mutate(
    Concentration = ((Signal_corr - intercept) / slope),
    Concentration = pmax(Concentration, 0),   # negative → 0
    Concentration = Concentration * 110       # apply dilution factor
  )
#write_csv(Samples, "Assays_calculated.csv")
#write_xlsx(Samples, "Assays_calculated.xlsx")
# R studio Version
rstudioapi::versionInfo()$version
## [1] '2026.7.1.147'
# Session report
sessioninfo::session_info()
## ─ Session info ───────────────────────────────────────────────────────────────
##  setting  value
##  version  R version 4.5.3 (2026-03-11 ucrt)
##  os       Windows 11 x64 (build 26200)
##  system   x86_64, mingw32
##  ui       RTerm
##  language (EN)
##  collate  Danish_Denmark.utf8
##  ctype    Danish_Denmark.utf8
##  tz       Europe/Copenhagen
##  date     2026-08-25
##  pandoc   3.8.3 @ C:/Program Files/RStudio/resources/app/bin/quarto/bin/tools/ (via rmarkdown)
##  quarto   1.9.38 @ C:\\PROGRA~1\\RStudio\\RESOUR~1\\app\\bin\\quarto\\bin\\quarto.exe
## 
## ─ Packages ───────────────────────────────────────────────────────────────────
##  package      * version date (UTC) lib source
##  bslib          0.11.0  2026-05-16 [1] CRAN (R 4.5.3)
##  cachem         1.1.0   2024-05-16 [1] CRAN (R 4.5.3)
##  cellranger     1.1.0   2016-07-27 [1] CRAN (R 4.5.3)
##  cli            3.6.6   2026-04-09 [1] CRAN (R 4.5.3)
##  digest         0.6.39  2025-11-19 [1] CRAN (R 4.5.3)
##  dplyr        * 1.2.1   2026-04-03 [1] CRAN (R 4.5.3)
##  evaluate       1.0.5   2025-08-27 [1] CRAN (R 4.5.3)
##  farver         2.1.2   2024-05-13 [1] CRAN (R 4.5.3)
##  fastmap        1.2.0   2024-05-15 [1] CRAN (R 4.5.3)
##  generics       0.1.4   2025-05-09 [1] CRAN (R 4.5.3)
##  ggplot2      * 4.0.2   2026-02-03 [1] CRAN (R 4.5.3)
##  glue           1.8.0   2024-09-30 [1] CRAN (R 4.5.3)
##  gtable         0.3.6   2024-10-25 [1] CRAN (R 4.5.3)
##  hms            1.1.4   2025-10-17 [1] CRAN (R 4.5.3)
##  htmltools      0.5.9   2025-12-04 [1] CRAN (R 4.5.3)
##  jquerylib      0.1.4   2021-04-26 [1] CRAN (R 4.5.3)
##  jsonlite       2.0.0   2025-03-27 [1] CRAN (R 4.5.3)
##  knitr          1.51    2025-12-20 [1] CRAN (R 4.5.3)
##  labeling       0.4.3   2023-08-29 [1] CRAN (R 4.5.2)
##  lifecycle      1.0.5   2026-01-08 [1] CRAN (R 4.5.3)
##  magrittr       2.0.5   2026-04-04 [1] CRAN (R 4.5.3)
##  otel           0.2.0   2025-08-29 [1] CRAN (R 4.5.3)
##  pillar         1.11.1  2025-09-17 [1] CRAN (R 4.5.3)
##  pkgconfig      2.0.3   2019-09-22 [1] CRAN (R 4.5.3)
##  purrr          1.2.2   2026-04-10 [1] CRAN (R 4.5.3)
##  R6             2.6.1   2025-02-15 [1] CRAN (R 4.5.3)
##  RColorBrewer   1.1-3   2022-04-03 [1] CRAN (R 4.5.2)
##  readr        * 2.2.0   2026-02-19 [1] CRAN (R 4.5.3)
##  readxl       * 1.4.5   2025-03-07 [1] CRAN (R 4.5.3)
##  rlang          1.2.0   2026-04-06 [1] CRAN (R 4.5.3)
##  rmarkdown      2.31    2026-03-26 [1] CRAN (R 4.5.3)
##  rstudioapi     0.19.0  2026-06-11 [1] CRAN (R 4.5.3)
##  S7             0.2.1   2025-11-14 [1] CRAN (R 4.5.3)
##  sass           0.4.10  2025-04-11 [1] CRAN (R 4.5.3)
##  scales         1.4.0   2025-04-24 [1] CRAN (R 4.5.3)
##  sessioninfo    1.2.4   2026-06-04 [1] CRAN (R 4.5.3)
##  tibble         3.3.1   2026-01-11 [1] CRAN (R 4.5.3)
##  tidyr        * 1.3.2   2025-12-19 [1] CRAN (R 4.5.3)
##  tidyselect     1.2.1   2024-03-11 [1] CRAN (R 4.5.3)
##  tzdb           0.5.0   2025-03-15 [1] CRAN (R 4.5.3)
##  vctrs          0.7.3   2026-04-11 [1] CRAN (R 4.5.3)
##  withr          3.0.3   2026-06-19 [1] CRAN (R 4.5.3)
##  xfun           0.57    2026-03-20 [1] CRAN (R 4.5.3)
##  yaml           2.3.12  2025-12-10 [1] CRAN (R 4.5.3)
## 
##  [1] C:/Users/wck955/AppData/Local/Programs/R/R-4.5.3/library
##  * ── Packages attached to the search path.
## 
## ──────────────────────────────────────────────────────────────────────────────